﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CrawlerTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] scores = { "http://osnews.com", "http://cnn.com"};
            Dictionary<string, string> bc;
            Console.WriteLine("Select Demo:");
            string input = Console.ReadLine();

            switch (input)
            {
                case "1":
                    //InteroperabilityDemo 1
                    var fs_scores = Microsoft.FSharp.Collections.List<string>.get_uniq_Empty();
                    for (int i = scores.Length - 1; i >= 0; i--)
                    {
                        fs_scores = Microsoft.FSharp.Collections.List<string>.Cons(scores[i],fs_scores);
                    }

                    foreach (Microsoft.FSharp.Core.Tuple<string, string> pair in InteroperabilityDemo1.download(fs_scores))//Microsoft.FSharp.Collections.ListModule.of_array(scores)))
                    {
                        Console.WriteLine(pair.Item2);
                    }
                    break;
                case "2":
                    //InteroperabilityDemo 2
                    foreach (Microsoft.FSharp.Core.Tuple<string, string> pair in InteroperabilityDemo2.download(scores.ToList<string>()))
                    {
                        Console.WriteLine(pair.Item2);
                    }
                    break;
                case "3":
                    //InteroperabilityDemo 3
                    bc = InteroperabilityDemo3.download(scores.ToList<string>());
                    foreach (string key in bc.Keys)
                    {
                        Console.WriteLine(bc[key]);
                    }
                    break;
                case "4":
                    //AsyncWorkflowDemo
                    bc = AsyncWorkflowDemo.download(scores.ToList<string>());
                    foreach (string key in bc.Keys)
                    {
                        Console.WriteLine(bc[key]);
                    }
                    break;

            }
        }
    }
}
